package com.example.weatherapi.controller;

import com.example.citycommon.dto.WeatherResponse;
import com.example.weatherapi.service.WeatherService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController

public class WeatherController {
    @Autowired
    WeatherService weatherService;


    @GetMapping("/search")
    public WeatherResponse search(@RequestParam String cityid) {
        WeatherResponse response = weatherService.searchWeather(cityid);
        return response;
    }
}
